%% air resistance
%Three parts (front resistance, front viscosity, and body viscosity)
function [F] = resistance( v1, v2, S)
    c=0.48;
    p=1.29;
    afa=1/3*pi;
    t_yiban=20;
    T=t_yiban+273.15;
    miu=1.7894*exp(-5)*(T/288.15)^1.5*((288.15+110.4)/(T+110.4));
    V_ct=2*v1+v2*cos(afa); 
    if v2<=0.609  
        d1=0.55637;
        d2=0.27874;
    elseif v2<=3.045
        d1=0.00037;
        d2=0.00074;
    else
        d1=-0.55563;
        d2=-0.27726;       
    end    
    HSR_ct=0.5*c*p*S*V_ct^2; 
    HSR_ctnx=S*miu*d1;
    HSR_csnx=2280*miu*d2;
    HSR=HSR_ct+HSR_ctnx+HSR_csnx;
    F=HSR;
end